<?php
	include_once "nguoidung_db.php";
	
	class nguoidung_bs
	{
		//--------------Field---------------
		private $MaNguoiDung = -1;
		public function SetMaNguoiDung($MaNguoiDung)         { $this->MaNguoiDung = $MaNguoiDung;         }
		public function GetMaNguoiDung()                     { return $this->MaNguoiDung;                 }
		
		private $MaLoaiNguoiDung = -1;
		public function SetMaLoaiNguoiDung($MaLoaiNguoiDung) { $this->MaLoaiNguoiDung = $MaLoaiNguoiDung; }
		public function GetMaLoaiNguoiDung()                 { return $this->MaLoaiNguoiDung;             }
		
		private $TenDangNhap = "";
		public function SetTenDangNhap($TenDangNhap)         { $this->TenDangNhap = $TenDangNhap;         }
		public function GetTenDangNhap()                     { return $this->TenDangNhap;                 }
		
		private $MatKhau = "";
		public function SetMatKhau($MatKhau)                 { $this->MatKhau = $MatKhau;                 }
		public function GetMatKhau()                         { return $this->MatKhau;                     }
		
		private $HoTen = "";
		public function SetHoTen($HoTen)                     { $this->HoTen = $HoTen;                     }
		public function GetHoTen()                           { return $this->HoTen;                       }
		
		private $DiaChi = "";
		public function SetDiaChi($DiaChi)                   { $this->DiaChi = $DiaChi;                   }
		public function GetDiaChi()                          { return $this->DiaChi;                      }
		
		private $DienThoai = "";
		public function SetDienThoai($DienThoai)             { $this->DienThoai = $DienThoai;             }
		public function GetDienThoai()                       { return $this->DienThoai;                   }
		
		private $GioiTinh = -1;
		public function SetGioiTinh($GioiTinh)               { $this->GioiTinh = $GioiTinh;               }
		public function GetGioiTinh()                        { return $this->GioiTinh;                    }
		
		private $NgaySinh = "0000-00-00";
		public function SetNgaySinh($NgaySinh)               { $this->NgaySinh = $NgaySinh;               }
		public function GetNgaySinh()                        { return $this->NgaySinh;                    }
		
		private $Email = "";
		public function SetEmail($Email)                     { $this->Email = $Email;                     }
		public function GetEmail()                           { return $this->Email;                       }
		
		private $NgayThamGia = "0000-00-00";
		public function SetNgayThamGia($NgayThamGia)         { $this->NgayThamGia = $NgayThamGia;         }
		public function GetNgayThamGia()                     { return $this->NgayThamGia;                 }
		
		private $MaTrangThai = -1;
		public function SetMaTrangThai($MaTrangThai)         { $this->MaTrangThai = $MaTrangThai;         }
		public function GetMaTrangThai()                     { return $this->MaTrangThai;                 }
		
		private $MaKichHoat = "";
		public function SetMaKichHoat($MaKichHoat)           { $this->MaKichHoat = $MaKichHoat;           }
		public function GetMaKichHoat()                      { return $this->MaKichHoat;                  }
		
		private $Avatar = "";
		public function SetAvatar($Avatar)                   { $this->Avatar = $Avatar;                   }
		public function GetAvatar()                          { return $this->Avatar;                      }
		
		//--------------Method---------------
		public function Them()
		{
			$data = new nguoidung_db();
			return $data->Them($this->MaLoaiNguoiDung,
							   $this->TenDangNhap, 
							   $this->MatKhau, 
							   $this->HoTen, 
							   $this->DiaChi,
							   $this->DienThoai, 
							   $this->GioiTinh, 
							   $this->NgaySinh, 
							   $this->Email, 
							   $this->NgayThamGia, 
							   $this->MaTrangThai, 
							   $this->MaKichHoat, 
							   $this->Avatar);
		}
		
		public function CapNhat()
		{
			$data = new nguoidung_db();
			return $data->CapNhat($this->MaNguoiDung,
								  $this->MaLoaiNguoiDung, 
								  $this->TenDangNhap, 
								  $this->MatKhau, 
								  $this->HoTen, 
								  $this->DiaChi, 
								  $this->DienThoai, 
								  $this->GioiTinh, 
								  $this->NgaySinh, 
								  $this->Email, 
								  $this->NgayThamGia, 
								  $this->MaTrangThai, 
								  $this->MaKichHoat,
								  $this->Avatar);
		}
		public function CapNhatAvatar()
		{
			$data = new nguoidung_db();
			return $data->CapNhatAvatar($this->TenDangNhap, $this->Avatar);
		}
		public function Xoa()
		{
			$data = new nguoidung_db();
			return $data->Xoa($this->MaNguoiDung);
		}
		
		public function LayDanhSach()
		{
			$data = new nguoidung_db();
			return $data->LayDanhSach($this->MaNguoiDung, $this->MaLoaiNguoiDung, $this->TenDangNhap, $this->MaTrangThai);
		}
		public function LayDanhSachPhanTrang($Start, $Limit)
		{
			$data = new nguoidung_db();
			return $data->LayDanhSachPhanTrang($Start, $Limit, $this->MaNguoiDung, $this->MaLoaiNguoiDung, $this->TenDangNhap, $this->MaTrangThai);
		}
		public function LayDanhSachTheoMaNguoiDung()
		{
			$data = new nguoidung_db();
			return $data->LayDanhSachTheoMaNguoiDung($this->MaNguoiDung);
		}
		public function LayHoTenTheoMa()
		{
			$data = new nguoidung_db();
			return $data->LayHoTenTheoMa($this->MaNguoiDung);
		}
		public function LayMatKhauTheoTenDangNhap()
		{
			$data = new nguoidung_db();
			return $data->LayMatKhauTheoTenDangNhap($this->TenDangNhap);
		}
		public function LayHoTenTheoTenDangNhap()
		{
			$data = new nguoidung_db();
			return $data->LayHoTenTheoTenDangNhap($this->TenDangNhap);
		}
		public function LayMaNguoiDungTheoTenDangNhap($TenDangNhap = "")
		{
			$data = new nguoidung_db();
			return $data->LayMaNguoiDungTheoTenDangNhap($this->TenDangNhap);
		}
		public function CapNhatMatKhau()
		{
			$data = new nguoidung_db();
			return $data->CapNhatMatKhau($this->TenDangNhap, $this->MatKhau);
		}
		public function CapNhatMaKichHoat()
		{
			$data = new nguoidung_db();
			return $data->CapNhatMaKichHoat($this->TenDangNhap, $this->MaKichHoat);
		}
		public function KiemTraTonTai()
		{
			$data = new nguoidung_db();
			return $data->KiemTraTonTai($this->MaNguoiDung, $this->TenDangNhap, $this->Email);
		}
		public function TonTaiTenDangNhap() 
		{
			$data = new nguoidung_db();
			return $data->TonTaiTenDangNhap($this->TenDangNhap);
		}
		public function TonTaiEmail() 
		{
			$data = new nguoidung_db();
			return $data->TonTaiEmail($this->Email);
		}
		public function LayTenDangNhapTheoEmail() 
		{
			$data = new nguoidung_db();
			return $data->LayTenDangNhapTheoEmail($this->Email);
		}
		public function LayMaXacNhanTheoTenDangNhap()
		{
			$data = new nguoidung_db();
			return $data->LayMaXacNhanTheoTenDangNhap($this->TenDangNhap);
		}
		public function CapNhatLoaiNguoiDungTheoTenDangNhap()
		{
			$data = new nguoidung_db();
			return $data->CapNhatLoaiNguoiDungTheoTenDangNhap($this->TenDangNhap, $this->MaLoaiNguoiDung);
		}
		public function CapNhatMaTrangThaiTheoTenDangNhap()
		{
			$data = new nguoidung_db();
			return $data->CapNhatMaTrangThaiTheoTenDangNhap($this->TenDangNhap, $this->MaTrangThai);
		}
		public function CapNhatMaTrangThai()
		{
			$data = new nguoidung_db();
			return $data->CapNhatMaTrangThai($this->MaNguoiDung, $this->MaTrangThai);
		}
		public function CapNhatMaKichHoatTheoMaNguoiDung()
		{
			$data = new nguoidung_db();
			return $data->CapNhatMaKichHoatTheoMaNguoiDung($this->MaNguoiDung, $this->MaKichHoat);
		}
		public function CapNhatLoaiNguoiDungTheoMaNguoiDung()
		{
			$data = new nguoidung_db();
			return $data->CapNhatLoaiNguoiDungTheoMaNguoiDung($this->MaNguoiDung, $this->MaLoaiNguoiDung);
		}
		
	}
?>